Skip to content

v0 [1/5]: JS SDK — context patch, startReactNativeSdk, Metro and Vite helpers - #21

Draft
adhorodyski wants to merge 1 commit into
v0from
stack/1-js-sdk
Draft

adhorodyski wants to merge 1 commit into
v0from
stack/1-js-sdk

Conversation

@adhorodyski

@adhorodyski adhorodyski commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Runtime context patch (R3) with startup probe and degraded scope attribute
  • startReactNativeSdk: attach to native or initialize it; web builds its own TracerProvider + proto exporter (R7)
  • Metro withOtel (setup before the main module, throws on an unmerged config) and Vite withOtel
  • Jest scenario harness, hand-off fixtures, *.js and *.shape expected files

Verified locally

bun verify static fast-js: 40 + 77 tests green; SDK bundle share 384 444 B vs the existing 383 873 B baseline (the example still uses the JS exporter until #24).

Not in this PR

Native cores (#22, #23), example apps and device runs (#24). VERIFY.md already describes the full pipeline.

Decisions for you (defaults applied; override with spec: comments)

  1. odd-attributes contract: NaN and ±Infinity export as doubles; -0 becomes int 0.
  2. One span per scenario body. Each scenario's body creates a single span, not several.
  3. Web (R7): web builds its own TracerProvider with the OTLP proto exporter instead of using startBrowserSdk. Spec §7 is rewritten, and @opentelemetry/browser-sdk is removed.
  4. interaction-manager: RN 0.88 removed InteractionManager, so this scenario stays pending. Either drop it, or extend the context patch to cover requestIdleCallback.
  5. Web flush on page hide: there is no test for it.
  6. Expected files: the *.js.otlp.json and *.shape.json files in verify/expected were drafted from the implementation and need your review.

Part of the v0 stack that replaces #20 for review: #21 JS SDK → #22 Android → #23 iOS → #24 examples + e2e → #25 ops. Each PR is one squashed commit holding its area in final form (later review fixes folded in); the stack top matches v0-impl except one stale CI comment fixed in #25. Full history: v0-impl / #20. Nothing publishes: release runs only after CI on main, and the npm environment does not exist yet.

🤖 Generated with Claude Code

…b), Metro and Vite helpers

Layer 1 of the v0 stack (squashed from v0-impl, PR #20):
- runtime context patch with startup probe and degraded scope attribute (R3)
- startReactNativeSdk: attach to native or initialize it; web builds its own TracerProvider and proto exporter (R7)
- Metro withOtel (InitializeCore first, throws on an unmerged config) and Vite withOtel
- Jest scenario harness, hand-off fixtures and js/shape expected files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread vite/index.js
@@ -0,0 +1,38 @@
/**

@adhorodyski adhorodyski Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why have both vite and jest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant